package sliver.action.advertisement;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import sliver.service.AdvertisementManager;

import com.opensymphony.xwork2.ActionSupport;

@Scope("prototype")
@Controller("advertisement.deletAdvertisementAction")
public class DeletAdvertisementAction extends ActionSupport{

	private static final long serialVersionUID = -4034041916776114061L;

	private Long advertisementId;
	
	@Autowired
	private AdvertisementManager advertisementManager;
	
	public DeletAdvertisementAction(){
		
	}
	
	public Long getAdvertisementId() {
		return advertisementId;
	}

	public void setAdvertisementId(Long advertisementId) {
		this.advertisementId = advertisementId;
	}

	@Override
	public String execute() throws Exception {
		
		advertisementManager.remove(advertisementId);
		return SUCCESS;
	}
}
